pub mod fs;

use mlua::prelude::*;

#[mlua::lua_module]
fn project_tree_lib(lua: &Lua) -> LuaResult<LuaTable> {
    let exports = lua.create_table()?;
    exports.set("greet", lua.create_function(greet)?)?;
    exports.set("tree", lua.create_function(fs::tree)?)?;
    Ok(exports)
}

fn greet(_: &Lua, name: String) -> LuaResult<String> {
    Ok(format!("Hello {}!", name))
}
